<?php
class qrcodeModule extends Module {
	
	/*
	 * 在构造函数中装载所依赖的类或其他文件
	*/
	function __construct() {
		$this->includePhp('qrcode', 'qrcode');
	}
	
	/*
	 * 调用插件资源
	*/
	public function call($user, $method, $param) {
		switch ($method) {
			case 'scanFromSubscribe':
				return qrcode::scanFromSubscribe($param->message);
			case 'scanFromScan':
				return qrcode::scanFromScan($param->message);
			case 'login':
				return qrcode::login($param->message);
            case 'register':
				return qrcode::register($param->message);
			case 'bindQRcodeLogin':
                return qrcode::bindQRcodeLogin($param->message);
            case 'qrcodeUnbind':
                return qrcode::qrcodeUnbind($param->message);
			case 'showNotLimitQRcode':
				$id = $param->id;
				if (!isset($id)) {
					Output::instance()->resultCode(code_lackof_param);
					return;
				}
				qrcode::showNotLimitQRcode($id);
				break;
            case 'QrUrl':
                qrcode::QrUrl($param);
                break;
		}
	}
}


$module = new qrcodeModule();
Module::addModule($module);